package com.baizhi.bzmall.admin.service.impl;

import com.baizhi.bzmall.admin.service.AdminService;
import com.baizhi.bzmall.dao.AdminDao;
import com.baizhi.bzmall.entity.BzAdmin;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service
public class AdminServiceImpl implements AdminService {
    @Autowired
    private AdminDao adminDao;
    @Override
    public List<BzAdmin> selectAll() {
        return adminDao.selectList(null);
    }

    @Override
    public BzAdmin selectOne(String username) {
        QueryWrapper<BzAdmin> wrapper=new QueryWrapper<>();
        wrapper.eq("username",username);//第一个参数是表里面的字段名，不能写成实体类的属性名
        return adminDao.selectOne(wrapper);
    }
}
